package main

import (
	"net/http"

	"github.com/gin-gonic/gin"
)

func main() {
	r := gin.Default()
	//简单分组1
	v1 := r.Group("/v1")
	{
		v1.POST("/login", func(c *gin.Context) {
			c.String(http.StatusOK, "v1/login~")
		})
		v1.POST("/read", func(c *gin.Context) {
			c.String(http.StatusOK, "v1/read~")
		})
	}
	//简单分组2
	v2 := r.Group("/v2")
	{
		v2.POST("/login", func(c *gin.Context) {
			c.String(http.StatusOK, "v2/login~")
		})
		v2.POST("/read", func(c *gin.Context) {
			c.String(http.StatusOK, "v2/read~")
		})
	}
	r.Run(":8081")
}

//curl -X POST "http://localhost:8081/v1/login"
//curl -X POST "http://localhost:8081/v2/login"
